package com.example.common.core;

import cn.hutool.core.util.StrUtil;
import java.util.List;
import org.mapstruct.Named;

/**
 * @author addzero
 * @since 2022-10-06 13:00:17
 */
public interface BaseConvert<ConditionInVO, InVO, OutVO, PO> {

    @Named("list2string")
    static String list2string(List<String> strings) {
        return StrUtil.join(",", strings);
    }

    @Named("string2list")
    static List<String> string2list(String str) {
        return StrUtil.split(",", str);
    }

    //<InBO> InBO vo2bo(InVO vo);

    //<OutBO> OutVO bo2vo(OutBO bo);

    PO vo2po(InVO vo);

    OutVO po2vo(PO po);

    //<InBO> List<InBO> vo2bos(List<InVO> vo);

    //<OutBO> List<OutVO> bo2vos(List<OutBO> bo);

    List<PO> vo2pos(List<InVO> vo);

    List<OutVO> po2vos(List<PO> po);

    PO conditionvo2po(ConditionInVO conditionInVO);

    ConditionInVO invo2conditioninvo(InVO vo);
}
